﻿using System;

namespace Csharphomework4_1
{
    class Program
    {

        static void Main(string[] args)
        {
            OrderService orderService = new OrderService();
            Console.WriteLine("----------------欢迎进入订单管理系统--------------");
            Console.WriteLine("|请选择服务                                       |");
            Console.WriteLine("|1、显示所有订单                                  |");
            Console.WriteLine("|2、添加订单                                      |");
            Console.WriteLine("|3、删除订单                                      |");
            Console.WriteLine("|4、查询订单                                      |");
            Console.WriteLine("|_________________________________________________|");

            string choice = Console.ReadLine();
            
            switch (choice)
            {
                case "1":
                    orderService.show();
                    break;
                case "2":
                    Console.WriteLine("请分别输入订单号，商品，顾客，金额");
                    long ordernum = long.Parse(Console.ReadLine());
                    string obj = Console.ReadLine();
                    string cus = Console.ReadLine();
                    int num = int.Parse(Console.ReadLine());
                    orderService.addOrder(ordernum,obj,cus,num);
                    break;
                case "3":
                    Console.WriteLine("请分别输入订单号，商品，顾客，金额");
                    long ordercount = long.Parse(Console.ReadLine());
                    string good = Console.ReadLine();
                    string cust = Console.ReadLine();
                    int number = int.Parse(Console.ReadLine());
                    orderService.deleteOrder(ordercount, good, cust, number);
                    break;
                case "4":
                    Console.WriteLine("请选择查找的方式:");
                    Console.WriteLine("1、查找订单号");
                    Console.WriteLine("2、查找商品订单");
                    Console.WriteLine("3、查找客户订单");
                    Console.WriteLine("4、按金额查找订单");

                    int decision = int.Parse(Console.ReadLine());
                    orderService.findOrder(decision);

                    break;
            }
            
        }
    }
}
